home *** CD-ROM | disk | FTP | other *** search
- Path: news.magmacom.com!not-for-mail
- From: ezust@mag1.magmacom.com (Acme Instant Dehydrated Boulder Kit)
- Newsgroups: comp.lang.c++
- Subject: Re: Is it OK to delete const *type pointers?
- Date: 4 Apr 1996 14:27:40 -0500
- Organization: Cloud-Zero, Canada
- Message-ID: <4k17rc$ltu@mag1.magmacom.com>
- References: <4jpq00$lhj@dub-news-svc-6.compuserve.com> <4k15m9$gf8@mag1.magmacom.com>
- NNTP-Posting-Host: mag1.magmacom.com
-
- In article <4k15m9$gf8@mag1.magmacom.com>,
- Acme Instant Dehydrated Boulder Kit <ezust@mag1.magmacom.com> wrote:
- >
- >deleting a pointer to a constant object is, IMHO, something which should not
- >be allowed by the language. And it is also something which is not permitted
- >by some compilers. I understand why the language might allow it, and I
- >understand why it might not. I've tried it on compilers which allow it,
- >and I have tried it on compilers which don't.
- >
- >What I want to know is, IS THERE SOMETHING IN THE DRAFT STANDARD that
- >discusses this? If so, where should I go to find it? Is a compiler which
- >actively prevents you from deleting a pointer to constant memory going
- >against the draft standard, or is it consistent with the language spec?
- >
- >While people's opinions on this subject are interesting, I've already
- >discussed it to death with co-workers. I just want to know why some
- >compilers don't let you do it and others do.
-
- I checked the draft standard myself and found what I think is the answer
- to my question...
-
- In the section
- 5.3.5 Delete
-
- it says this:
-
- 4 It is unspecified whether the deletion of an object changes its value.
-
- If I interpret this the way I think I should, what this means is that in
- theory it is okay to delete a pointer to constant memory, but compilers
- can conform to the standard by generating an error, warning, or just
- compiling it without any warning or error. Am I right?
-
- Why doesn't something get added to the draft standard which emphatically
- states whether this should be permitted or not? It seems rather silly to
- leave this unspecified...
-
-
- --
- Alan Ezust "Just because I work for the federal
- Ottawa, Canada government doesn't mean I'm an expert
- ezust@magmacom.com on cockroaches" -Special Agent Fox Mulder
- http://www2.magmacom.com/~ezust
-